﻿@model TrialControllerModel.Index
<div class="page">
    <div class="pageHeader">
        <form id="pagerForm" onsubmit="return navTabSearch(this);" action="/game/trial" method="post">
        <div class="searchBar">
            <table class="searchContent">
                <tr>
                    <td>
                        游戏区服：
                        <select name="ServerId">
                            <option value="" @(Model.ServerId == 0 ? "selected=selected" : string.Empty)>请选择游戏区服</option>
                            @foreach (var o in Model.Games)
                            {
                                <optgroup label="@o.Name">
                                    @foreach (var i in o.Servers.Where(x => x.JoinTrial))
                                    { 
                                        <option value ="@(i.Id)" @(Model.ServerId == i.Id ? "selected=selected" : string.Empty)>@(o.Name)--@i.Name</option>
                                    }
                                </optgroup>
                            }
                        </select>
                    </td>
                    <td>
                        @if (Model.Server != null)
                        {
                            <span>时间：@Model.Server.EndTime.ToString("yyyy-MM-dd HH:mm:ss", string.Empty) 至 @Model.Server.EndTime.ToString("yyyy-MM-dd HH:mm:ss", string.Empty)
                            </span>               
                        }
                    </td>
                </tr>
            </table>
            <div class="subBar">
                <ul>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">
                                    检索</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        </form>
    </div>
    <div>
        <div class="panelBar">
            <ul class="toolBar">
                @if (Model.Server != null)
                {
                    <li><a class="add" href="/game/trial/detail?serverId=@(Model.ServerId)" target="dialog" title="添加试玩"
                                            mask="true" onclick=" javascript:void(0); " rel="game/server/info">
                        <span>添 加</span></a></li>
                    <li class="line">line</li>
                    <li><a class="edit" href="/game/trial/detail/{param}?serverId=@(Model.ServerId)" target="dialog" title="修改试玩"
                                            mask="true" onclick=" javascript:void(0); " rel="game/server/info">
                        <span>修 改</span></a></li>
                }
            </ul>
        </div>
        <table class="table" layouth="138" width="100%">
            <thead>
                <tr>
                    <th width="50">
                        Id
                    </th>
                    <th width="100">
                        等级
                    </th>
                    <th>
                        兑换积分
                    </th>
                    <th width="160">
                        创建时间
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var o in Model.Trials)
                {
                    <tr target="param" rel="@o.Id">
                        <td>@o.Id
                        </td>
                        <td>@o.Level
                        </td>
                        <td>@o.Integral
                        </td>
                        <td>
                            @o.CreatedOn.ToString("yyy-MM-dd HH:mm:ss")
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>
